<!DOCTYPE html>
<html>
<head>
    <title></title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
                </i-col>
                <i-button @click="query">查询</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("version:info"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("version:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;查看</i-button>
                #end
                #if($shiro.hasPermission("version:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end

            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="version"  :label-width="100">
            <Form-item label="编号" prop="id">
                <i-input v-model="version.id" placeholder="编号" disabled/>
            </Form-item>
            <Row>
                <i-col span="16">
                    <Form-item label="下载地址" prop="apkAddr">
                        <i-input v-model="version.apkAddr" placeholder="下载地址" readonly/>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload action="../sys/oss/upload?prefix=android" :format="['apk']"
                                :on-success="handleSuccessPicUrl" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize"
                        >
                            <i-button icon="ios-cloud-upload-outline">上传apk安装包</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item label="版本号" prop="versionCode">
                <i-input v-model="version.versionCode" placeholder="版本号"/>
            </Form-item>
            <Form-item label="版本名称" prop="versionName">
                <i-input v-model="version.versionName" placeholder="版本名称"/>
            </Form-item>
            <Form-item label="更新提示" prop="msg">
                <i-input type="textarea" v-model="version.msg" placeholder="更新提示"/>
            </Form-item>

            <Form-item label="版本类型" prop="type">
                <Radio-group v-model="version.type">
                    <Radio label="0">
                        <span>安卓</span>
                    </Radio>
                    <Radio label="1">
                        <span>苹果</span>
                    </Radio>
                </Radio-group>
            </Form-item >

            <Form-item label="是否强制更新" prop="mustUpdate">
                <Radio-group v-model="version.mustUpdate">
                    <Radio label="0">
                        <span>不强制</span>
                    </Radio>
                    <Radio label="1">
                        <span>自动更新</span>
                    </Radio>
                    <Radio label="2">
                         <span>强制更新</span>
                     </Radio>

                </Radio-group>
            </Form-item>
            <Form-item label="加密串" prop="fileMd5">
                <i-input v-model="version.fileMd5" placeholder="加密串"/>
            </Form-item>
            <Form-item label="创建日期" prop="retailPrice">
                <i-input v-model="version.createDate" placeholder="创建日期"/>
            </Form-item>

            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/cms/version.js?_${date.systemTime}"></script>
</body>
</html>